# Maintainer: George Rawlinson <grawlinson@archlinux.org>
# Contributor: Eli Schwartz <eschwartz@archlinux.org>

pkgname=checkbashisms
pkgver=2.23.6
pkgrel=1
pkgdesc='Debian script that checks for bashisms'
arch=('any')
url='https://tracker.debian.org/pkg/devscripts'
license=('GPL')
depends=('perl')
source=("https://salsa.debian.org/debian/devscripts/-/archive/v$pkgver/devscripts-v$pkgver.tar.gz")
sha512sums=('45887bba7797e920a7e525ad2462b9ad409bd6a435413b8e5c8f68ab37591a6b5469248619d4eebe286dee1f37030fe6f4b4b280c5883893a9e4293bd262c6b6')
b2sums=('1ffd2c1a940227c7dbacd79230e6dd238408be5af5b28d6702c85e1fe17f515880816bcdda2a8d90edfe48d40056c827ebda5b17603a7dabc078adc2931b9cdb')

prepare() {
  cd "devscripts-v$pkgver/scripts"

  sed "s/###VERSION###/$pkgver/g" checkbashisms.pl > checkbashisms
}

package() {
  cd "devscripts-v$pkgver/scripts"

  # binary
  install -vDm755 -t "$pkgdir/usr/bin" "$pkgname"

  # man page
  install -vDm644 -t "$pkgdir/usr/share/man/man1" "$pkgname.1"

  # bash completions
  install -vDm644 "$pkgname.bash_completion" "$pkgdir/usr/share/bash-completion/completions/$pkgname"
}
